<%-- 
    Document   : corrente
    Created on : 13/12/2011, 14:56:42
    Author     : Fatec
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="stylesheet" href="cmstyle.css">
        <title>Conversor de Corrente Elétrica</title>
    </head>
    <body>
        <ul class="navbar">
            <li><a href="javascript:window.history.go(-1)">Voltar</a>
            <li><a href="/conversorMedidas/"> Home Page </a>
            <li><a href="equipe.jsp">Quem somos?</a>
            <li><a href="volume.jsp">Volume</a>
            <li><a href="moeda.jsp">Moeda</a>
            <li><a href="corrente.jsp">Corrente Elétrica</a>
        </ul>
        <form name="Entrada" action="">
            <br><BR>
            Quero Converter: <input type="text" name="entrada" value=<%=request.getParameter("entrada")%> />
            <select name="TipoAmpere">
                <option>NanoAmpere</option>
                <option>MicroAmpere</option>
                <option>MiliAmpere</option>
                <option>Ampere</option>
                <option>KiloAmpere</option>
                <option>MegaAmpere</option>
                <option>GigaAmpere</option>
                <option>Abampere</option>
                <option>Coulomb por Segundo</option>
            </select>
            <input type="submit" value="Converter" name="bot" />
        </form>

        <%  try {
                        if (request.getParameter("TipoAmpere") != null && request.getParameter("entrada") != null) {
                            if (request.getParameter("TipoAmpere").equals("NanoAmpere")) {
                                Double num = Double.parseDouble(request.getParameter("entrada"));
                                Double res = num * 1;
        %>
        <br>
        <br>
        <br>
        <br>
        <br>
        <h1>Você selecionou NanoAmpére</h1>
        <h3>NanoAmpére: <%=res%></h3>
        <% res = num * 0.001;%>
        <h3>MicroAmpére: <%=res%></h3>
        <% res = num * 0.000001;%>
        <h3>MiliAmpére: <%=res%></h3>
        <%res = num * 0.000000001;%>
        <h3>Ampére: <%=res%></h3>
        <%res = num * 0.000000000001;%>
        <h3>KiloAmpére: <%=res%></h3>
        <%res = num * 0.000000000000001;%>
        <h3>MegaAmpére: <%=res%></h3>
        <%res = num * 0.000000000000000001;%>
        <h3>GigaAmpére: <%=res%></h3>
        <%res = num * 0.0000000001;%>
        <h3>Abampére: <%=res%></h3>
        <%res = num * 0.000000001;%>
        <h3>Coulomb por Segundo: <%=res%></h3>
        <%
                                    } else if (request.getParameter("TipoAmpere").equals("MiliAmpere")) {
                                        Double num = Double.parseDouble(request.getParameter("entrada"));
                                        Double res = num * 1000000;
        %>
        <br>
        <br>
        <br>
        <br>
        <br>
        <h1>Você selecionou MiliAmpére</h1>
        <h3>NanoAmpére: <%=res%></h3>
        <% res = num * 1000;%>
        <h3>MicroAmpére: <%=res%></h3>
        <% res = num * 1;%>
        <h3>MiliAmpére: <%=res%></h3>
        <%res = num * 0.001;%>
        <h3>Ampére: <%=res%></h3>
        <%res = num * 0.000001;%>
        <h3>KiloAmpére: <%=res%></h3>
        <%res = num * 0.000000001;%>
        <h3>MegaAmpére: <%=res%></h3>
        <%res = num * 0.000000000001;%>
        <h3>GigaAmpére: <%=res%></h3>
        <%res = num * 0.0001;%>
        <h3>Abampére: <%=res%></h3>
        <%res = num * 0.001;%>
        <h3>Coulomb por Segundo: <%=res%></h3>
        <%
                                    } else if (request.getParameter("TipoAmpere").equals("MicroAmpere")) {
                                        Double num = Double.parseDouble(request.getParameter("entrada"));
                                        Double res = num * 1000;
        %>
        <br>
        <br>
        <br>
        <br>
        <br>
        <h1>Você selecionou MicroAmpére</h1>
        <h3>NanoAmpére: <%=res%></h3>
        <% res = num * 1;%>
        <h3>MicroAmpére: <%=res%></h3>
        <% res = num * 0.001;%>
        <h3>MiliAmpére: <%=res%></h3>
        <%res = num * 0.000001;%>
        <h3>Ampére: <%=res%></h3>
        <%res = num * 0.000000001;%>
        <h3>KiloAmpére: <%=res%></h3>
        <%res = num * 0.000000000001;%>
        <h3>MegaAmpére: <%=res%></h3>
        <%res = num * 0.000000000000001;%>
        <h3>GigaAmpére: <%=res%></h3>
        <%res = num * 0.0000001;%>
        <h3>Abampére: <%=res%></h3>
        <%res = num * 0.000001;%>
        <h3>Coulomb por Segundo: <%=res%></h3>
        <% } else if (request.getParameter("TipoAmpere").equals("Ampere")) {
                                        Double num = Double.parseDouble(request.getParameter("entrada"));
                                        Double res = num * 1000000000;
        %>
        <br>
        <br>
        <br>
        <br>
        <br>
        <h1>Você selecionou Ampére</h1>
        <h3>NanoAmpére: <%=res%></h3>
        <% res = num * 1000000;%>
        <h3>MicroAmpére: <%=res%></h3>
        <% res = num * 1000;%>
        <h3>MiliAmpére: <%=res%></h3>
        <%res = num * 1;%>
        <h3>Ampére: <%=res%></h3>
        <%res = num * 0.001;%>
        <h3>KiloAmpére: <%=res%></h3>
        <%res = num * 0.000001;%>
        <h3>MegaAmpére: <%=res%></h3>
        <%res = num * 0.000000001;%>
        <h3>GigaAmpére: <%=res%></h3>
        <%res = num * 0.1;%>
        <h3>Abampére: <%=res%></h3>
        <%res = num * 1;%>
        <h3>Coulomb por Segundo: <%=res%></h3>
        <% } else if (request.getParameter("TipoAmpere").equals("KiloAmpere")) {
                                        Double num = Double.parseDouble(request.getParameter("entrada"));
                                        Double res = num * (1000000000 * 1000);%>
        <br>
        <br>
        <br>
        <br>
        <br>
        <h1>Você selecionou KiloAmpére</h1>
        <h3>NanoAmpére: <%=res%></h3>
        <% res = num * 1000000000;%>
        <h3>MicroAmpére: <%=res%></h3>
        <% res = num * 1000000;%>
        <h3>MiliAmpére: <%=res%></h3>
        <%res = num * 1000;%>
        <h3>Ampére: <%=res%></h3>
        <%res = num * 1;%>
        <h3>KiloAmpére: <%=res%></h3>
        <%res = num * 0.001;%>
        <h3>MegaAmpére: <%=res%></h3>
        <%res = num * 0.000001;%>
        <h3>GigaAmpére: <%=res%></h3>
        <%res = num * 100;%>
        <h3>Abampére: <%=res%></h3>
        <%res = num * 1000;%>
        <h3>Coulomb por Segundo: <%=res%></h3>
        <% } else if (request.getParameter("TipoAmpere").equals("MegaAmpere")) {
                                        Double num = Double.parseDouble(request.getParameter("entrada"));
                                        Double res = num * (1000000000 * 1000000);%>
        <br>
        <br>
        <br>
        <br>
        <br>
        <h1>Você selecionou MegaAmpére</h1>
        <h3>NanoAmpére: <%=res%></h3>
        <% res = num * (1000000000 * 1000);%>
        <h3>MicroAmpére: <%=res%></h3>
        <% res = num * 1000000000;%>
        <h3>MiliAmpére: <%=res%></h3>
        <%res = num * 1000000;%>
        <h3>Ampére: <%=res%></h3>
        <%res = num * 1000;%>
        <h3>KiloAmpére: <%=res%></h3>
        <%res = num * 1;%>
        <h3>MegaAmpére: <%=res%></h3>
        <%res = num * 0.001;%>
        <h3>GigaAmpére: <%=res%></h3>
        <%res = num * 100000;%>
        <h3>Abampére: <%=res%></h3>
        <%res = num * 1000000;%>
        <h3>Coulomb por Segundo: <%=res%></h3>
        <%   } else if (request.getParameter("TipoAmpere").equals("GigaAmpere")) {
                                        Double num = Double.parseDouble(request.getParameter("entrada"));
                                        Double res = num * (1000000000 * 1000000000);%>
        <br>
        <br>
        <br>
        <br>
        <br>
        <h1>Você selecionou GigaAmpére</h1>
        <h3>NanoAmpére: <%=res%></h3>
        <% res = num * (1000000000 * 1000000);%>
        <h3>MicroAmpére: <%=res%></h3>
        <% res = num * (1000000000 * 1000);%>
        <h3>MiliAmpére: <%=res%></h3>
        <%res = num * 1000000000;%>
        <h3>Ampére: <%=res%></h3>
        <%res = num * 1000000;%>
        <h3>KiloAmpére: <%=res%></h3>
        <%res = num * 1000;%>
        <h3>MegaAmpére: <%=res%></h3>
        <%res = num * 1;%>
        <h3>GigaAmpére: <%=res%></h3>
        <%res = num * 100000000;%>
        <h3>Abampére: <%=res%></h3>
        <%res = num * 1000000000;%>
        <h3>Coulomb por Segundo: <%=res%></h3>
        <%  } else if (request.getParameter("TipoAmpere").equals("Abampere")) {
                                        Double num = Double.parseDouble(request.getParameter("entrada"));
                                        Double res = num * (1000000000 * 10);%>
        <br>
        <br>
        <br>
        <br>
        <br>
        <h1>Você selecionou Abampére</h1>
        <h3>NanoAmpére: <%=res%></h3>
        <% res = num * 10000000;%>
        <h3>MicroAmpére: <%=res%></h3>
        <% res = num * 10000;%>
        <h3>MiliAmpére: <%=res%></h3>
        <%res = num * 10;%>
        <h3>Ampére: <%=res%></h3>
        <%res = num * 0.01;%>
        <h3>KiloAmpére: <%=res%></h3>
        <%res = num * 0.00001;%>
        <h3>MegaAmpére: <%=res%></h3>
        <%res = num * 0.00000001;%>
        <h3>GigaAmpére: <%=res%></h3>
        <%res = num * 1;%>
        <h3>Abampére: <%=res%></h3>
        <%res = num * 10;%>
        <h3>Coulomb por Segundo: <%=res%></h3>
        <% } else if (request.getParameter("TipoAmpere").equals("Coulomb por Segundo")) {
                                        Double num = Double.parseDouble(request.getParameter("entrada"));
                                        Double res = num * (1000000000 * 100);%>
        <br>
        <br>
        <br>
        <br>
        <br>
        <h1>Você selecionou Coulomb por Segundo</h1>
        <h3>NanoAmpére: <%=res%></h3>
        <% res = num * 100000000;%>
        <h3>MicroAmpére: <%=res%></h3>
        <% res = num * 100000;%>
        <h3>MiliAmpére: <%=res%></h3>
        <%res = num * 100;%>
        <h3>Ampére: <%=res%></h3>
        <%res = num * 10;%>
        <h3>KiloAmpére: <%=res%></h3>
        <%res = num * 0.01;%>
        <h3>MegaAmpére: <%=res%></h3>
        <%res = num * 0.0001;%>
        <h3>GigaAmpére: <%=res%></h3>
        <%res = num * 0.1;%>
        <h3>Abampére: <%=res%></h3>
        <%res = num * 1;%>
        <h3>Coulomb por Segundo: <%=res%></h3>
        <% }
              }
          } catch (Exception e) {%><br><br><h1>Valor não Informado ou Valor Incorreto, favor informar valor para conversão</h1><%                      }
        %></body>
</html>